import { http } from '@/utils/http.js'

/**
 * 药品预付订单
 */
export const preOrderApi = (prescriptionId) => {
  return http.request({
    url: '/patient/medicine/order/pre',
    params: prescriptionId
  })
}

/**
 * 药品待支付订单
 */
export const createOrderApi = (id, addressId) => {
  return http.request({
    method: 'POST',
    url: '/patient/medicine/order',
    data: {
      id,
      addressId
    }
  })
}

// 药品订单-查询订单详情信息
export const getPatientMedicineOrderDetailApi = (id) => {
  return http.request({
    method: 'GET',
    url: '/patient/medicine/order/detail/' + id
  })
}

/**
 * 药品订单列表
 */
export const orderListApi = (status = 10, current = 1, pageSize = 10) => {
  return http.request({
    url: '/patient/medicine/order/mylist',
    params: { status, current, pageSize }
  })
}

/**
 * 查看物流
 */
export const logisticsApi = (id) => {
  return http.get(`/patient/order/${id}/logistics`)
}
